<template>
  <h1></h1>
</template>

<script>
/**
 * {刷新登录}
 *
 * @author: 宋康
 * @date: 2023/1/31
 */
import {reLogin} from '@/api/login'

export default {
  name: "RefreshLogin",
  methods: {
    reLogin() {
      this._debounce(() => reLogin(this.$store.state.Authentication.refresh_token).then(res => {
        if (!res.status) {
          this.$store.commit("removeAuthentication");
        } else {
          this.$store.commit("setAuthentication", res.data)
        }
        setTimeout(() => {
          const furi = this.$route.query.furi;
          this.$router.replace(decodeURI(furi) || '/');
        }, 500)
      }), 500)
    }
  },
  mounted() {
    this.reLogin();
  }
}
</script>

<style scoped>

</style>